import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 递归打印数字的每一位
 * User: 15085202591
 * Date: 2022-11-03
 * Time: 18:47
 */
public class Print {
    public static void printNum(int x){
        if (x > 9){
            printNum(x / 10);
        }
        System.out.print(x % 10+" ");
        return;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字：");
        while (sc.hasNextInt()){
            int n = sc.nextInt();
            printNum(n);
            System.out.println();
            System.out.println("输入数字：");
        }
    }
}
